home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3500 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: EU.net!sun4nl!xs4all!usenet
  2. From: veenb@xs4all.nl (Barend ten Veen)
  3. Newsgroups: comp.lang.c++
  4. Subject: Problem with TIcon and win32 with BC4.53
  5. Date: Wed, 24 Jan 1996 13:15:02 GMT
  6. Organization: XS4ALL, networking for the masses
  7. Message-ID: <4e57j7$cs3@news.xs4all.nl>
  8. NNTP-Posting-Host: asd09-29.dial.xs4all.nl
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Hello,
  12.  
  13. I have a problem porting a 16 bit Windows application to 32 bit.
  14. In the 16 bit application i used the following code to create an
  15. TIcon.
  16.  
  17. . . .
  18.  
  19. HICON Hand;
  20. TIcon *AppIcon;
  21.  
  22. char Commando[]="blabla.exe";
  23.  
  24.     AppIcon=0;
  25.     Hand=0;
  26.  
  27.     // The following line check for an icon in the file
  28.  
  29.     Hand=ExtractIcon (0, (LPSTR)Commando, 0);
  30.  
  31.     if ((int)Hand != NULL && (int)Hand !=1)
  32.         AppIcon=new TIcon (0, Commando, 0);
  33. . . .
  34.  
  35. Later on in the program i use the AppIcon.
  36.  
  37. This works fine white my 16 bits application.
  38.  
  39. When i port this code to 32 bit the compiler and linker don't 
  40. gives errors.
  41. But when i run it i get an Exception failure:
  42. GDI Exception.
  43.  
  44. With the 32bit turbo debugger i get the following message:
  45. Stopped on execution throw of type TGdiBase::TXGdi.
  46. The exception occurs at the
  47.     AppIcon=new TIcon (0, Commando, 0);
  48. line
  49.  
  50. Can someone help me with this.
  51. I tryed several other ways for creating the TIcon but always get
  52. the same exception.
  53.  
  54.  
  55. Thanx in advance.
  56. Barend.
  57. veenb@xs4all.nl
  58.  
  59.  
  60.  
  61.